package com.rabbitmq.demo.autoack;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;


public class Sender {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Scheduled(fixedDelay = 5000,initialDelay = 1000)
    public void send(){
        rabbitTemplate.convertAndSend("direct.exchange","queue","Hello! Everyone!");
    }
}
